// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   responsiblePersonName_delete_ok.java

package design.config.file;

import include.nseer_db.nseer_db_backup1;
import java.io.IOException;
import java.sql.ResultSet;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.jsp.JspFactory;

public class responsiblePersonName_delete_ok extends HttpServlet
{

	public responsiblePersonName_delete_ok()
	{
	}

	public synchronized void service(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException
	{
		HttpSession dbSession = request.getSession();
		JspFactory _jspxFactory = JspFactory.getDefaultFactory();
		javax.servlet.jsp.PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
		javax.servlet.ServletContext dbApplication = dbSession.getServletContext();
		nseer_db_backup1 design_db = new nseer_db_backup1(dbApplication);
		HttpSession session = request.getSession(true);
		try
		{
			if (design_db.conn((String)dbSession.getAttribute("unit_db_name")))
			{
				int intRowCount = 0;
				String sqll = "select * from design_config_responsibleperson";
				ResultSet rs = design_db.executeQuery(sqll);
				rs.next();
				rs.last();
				intRowCount = rs.getRow();
				String del[] = new String[intRowCount];
				del = (String[])session.getAttribute("del");
				if (del != null)
				{
					for (int i = 1; i <= intRowCount; i++)
						try
						{
							if (del[i - 1] != null)
							{
								String sql = (new StringBuilder("delete from design_config_responsibleperson where id='")).append(del[i - 1]).append("'").toString();
								design_db.executeUpdate(sql);
							}
						}
						catch (Exception ex)
						{
							ex.printStackTrace();
						}

				}
				design_db.commit();
				design_db.close();
				response.sendRedirect("design/config/file/responsiblePersonName.jsp");
			} else
			{
				response.sendRedirect("error_conn.htm");
			}
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
}
